<?php
$view_post = '<div class="boxleft"><div class="titleleft"></div><div class="titlecenter"><a href="'.$row_menu_one['url'].'">'.$row_menu_one['name'].'</a></div><div class="titleright"></div><div class="titleicon"></div><div style="clear:both; height:1px"></div><div id="chuongtrinh">';
$thuvien = $tc->thuvien($idMenu,$type);
$total = mysql_num_rows($thuvien);

while($row_thuvien = mysql_fetch_array($thuvien)){
	$view_post .= '<div class="item_ti"><h4>'.$row_thuvien['name'].'</h4><h6>'.$row_thuvien['name'].'</h6></div>';
	$thuvien2 = $tc->thuvien_sub($row_thuvien['id']);
	while($row_thuvien2 = mysql_fetch_array($thuvien2)){
		if($row_thuvien2['type_id']==5) $view_post .= '<div class="item_img"><a href="'.$row_thuvien2['url'].'"><img src="'.url_danhmuc_image.$row_thuvien2['url_hinh'].'" alt="'.$row_thuvien2['name'].'"><h3 class="transparent_class">'.$row_thuvien2['name'].'</h3></a></div>';
		elseif($row_thuvien2['type_id']==6) $view_post .= '<div class="item_video"><a href="'.$row_thuvien2['url'].'"><img src="'.url_danhmuc_image.$row_thuvien2['url_hinh'].'" alt="'.$row_thuvien2['name'].'"><h3>'.$row_thuvien2['name'].'</h3></a></div>';
		else $view_post .= '<div class="item_img"><a href="'.$row_thuvien2['url'].'"><img src="'.url_danhmuc_image.$row_thuvien2['url_hinh'].'" alt="'.$row_thuvien2['name'].'"><h3 class="transparent_class">'.$row_thuvien2['name'].'</h3></a></div>';
	}
	$view_post .= '<div style="clear:both; height:10px"></div>';
}
$view_post .= '</div><div style="clear:both"></div></div>';
